package com.zhenhao.xsq.data.api;




import com.zhenhao.xsq.entity.BaseDataEntity;
import com.zhenhao.xsq.entity.BaseEntity;
import com.zhenhao.xsq.entity.LoginEntity;
import com.zhenhao.xsq.entity.UserInfoEntity;
import com.zhenhao.xsq.entity.login.UserEntity;

import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Path;
import retrofit2.http.QueryMap;

import static com.zhenhao.xsq.data.api.API.*;

/**
 * Created by hu on 2017/5/16.
 */

public interface HttpApi {
//    @GET(G_get)
//    Observable<BaseEntity> get(@QueryMap Map<String, RequestBody> params);


//    @POST(G_get)
//    @FormUrlEncoded
//    Observable<BaseEntity> post(@FieldMap Map<String, RequestBody> params);

    //    @Multipart
//    @POST(G_get)
//    Observable<BaseEntity> upload(@Part MultipartBody.Part file);


//    @Headers({"Content-Type: application/json", "Accept: application/json"})
//    @POST(xunjian_uploadpatrolresult)
//    Observable<BaseEntity> newUploadPatrolResult(@Body RequestBody route);
//    Observable<BaseEntity> newUploadPatrolResult1(@Body RequestBody params);


    @GET(user_login)
    Observable<BaseDataEntity> userLogin(@QueryMap Map<String, RequestBody> params);

    @GET(user_code + "/{tel}/{xmbh}")
    Observable<BaseEntity> getCode(@Path("tel") String token, @Path("xmbh") String xmbh,
                                   @QueryMap Map<String,
                                           RequestBody>
                                           params);

    @GET(user_logintout + "/{token}")
    Observable<BaseEntity> userLoginOut(@Path("token") String token, @QueryMap Map<String,
            RequestBody> params);

    @GET(user_info)
    Observable<UserEntity> userInfo(@QueryMap Map<String, RequestBody> params);

}